from bs4 import BeautifulSoup

soup = BeautifulSoup("<b><!--This is a comment--></b>")
comment = soup.b.string
print(comment)          
print(type(comment))    